from django.db import models

# Create your models here.


#用户
class UserModel(models.Model):
    mobile=models.CharField('手机号',max_length=11)
    class Meta:
        db_table='usermdel'
        verbose_name_plural='登录'
    def __str__(self):
        return self.mobile


#分类
class HotelModel(models.Model):
    name=models.CharField('分类名',max_length=20)
    set=models.CharField('风景名字',max_length=20)

    class Meta:
        db_table = 'hotelModel'
        verbose_name_plural = '分类'

    def __str__(self):
        return self.name


#详情
class SetModel(models.Model):
    name = models.CharField('位置', max_length=20)
    set = models.CharField('酒店', max_length=20)
    tt=models.ForeignKey(HotelModel,on_delete=models.CASCADE,verbose_name='外键')
    class Meta:
        db_table = 'setModel'
        verbose_name_plural = '详情'

    def __str__(self):
        return self.name




